package tech.aistar.mapper.collecte;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import tech.aistar.entity.Collecte;

import java.util.List;

/**
 * Created by Administrator on 2019/9/27 0027.
 */
@Repository
public interface CollecteMapper {
    //删除
//    @Update("update collecte set status = 1 where id = #{value}")
//    void coldelById(Integer id);

    @Delete("delete from collecte  where id = #{value}")
    void coldelById(Integer id);

    @Update("update collecte set status = 1 where services_id = #{value}")
    void del(Integer servicesId);

    //查询
    @Select("select * from collecte")
    List<Collecte> colFindAll();
    //根据userId查询
    @Select("select * from collecte where userinfo_id=#{value}")
    List<Collecte> coluserFindOne(Integer id);

    @Select("select * from collecte where services_id=#{value}")
    List<Collecte> serviceFind(Integer servicesId);

    //添加1 收藏
    @Insert("insert into collecte(userinfo_id,province,city,url,services_id,status) values(#{userinfoId},#{province},#{city},#{url},#{servicesId},#{status})")
    void colSave(Collecte collecte);








}
